//
//  String+Extension.swift
//  IPlan
//
//  Created by robot on 3/25/16.
//  Copyright © 2016 codeFighter.com. All rights reserved.
//

import UIKit

extension String{


    func stringHeightWithFont(_ font: UIFont,contentWidth width: CGFloat) ->CGFloat{
    
        let convertString: NSString? = self as NSString
        
        let textSize = CGSize(width: width, height: CGFloat(MAXFLOAT))
        

        let textRect:CGRect = (convertString?.boundingRect(with: textSize, options:NSStringDrawingOptions(rawValue: NSStringDrawingOptions.usesLineFragmentOrigin.rawValue | NSStringDrawingOptions.usesLineFragmentOrigin.rawValue), attributes: [NSFontAttributeName:font], context: nil))!

        
        return textRect.height;
    
    }


}
